<template>
  <div class="wrapper" id="app">
      <keep-alive exclude="header-component">
        <router-view v-if="$route.meta.keepAlive&&isRouterAlive"/>
      </keep-alive>
      <router-view v-if="!$route.meta.keepAlive&&isRouterAlive"/>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      isRouterAlive: true
    };
  },
  provide() {
    return {
      reload: this.reload
    };
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function() {
        this.isRouterAlive = true;
      });
    }
  }
};
</script>
